package com.myschool.server.dao.impl;


import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.springframework.stereotype.Repository;

import com.myschool.server.dao.AttandenceDao;
import com.myschool.server.dao.support.BaseEntityDaoHibernate;
import com.myschool.server.model.Attendance;

@Repository
public class AttandenceDaoImpl extends BaseEntityDaoHibernate<Attendance>  implements
AttandenceDao{

	public AttandenceDaoImpl() {
		super(Attendance.class); 
	}

	@Override
	public Set<Attendance> retriveAttandenceBySection(Long secitionID, Date date) {
		// TODO Auto-generated method stub
		return new HashSet<Attendance>(getHibernateTemplate().find(
			//	" from Attendance att  where att.section.entityId = ?  ", secitionID ));
		" from Attendance att  where att.section.entityId = ? and att.attendanceDate =?", secitionID, date));
	}
}
